#cfgparser, parses the configuration file

import re

def source():

	config = open("filechecker.cfg", "r")
	text = config.read()
	match = re.search(r"(src=)(.*\.*)", text)
	
	return match.group(2)


def dest():
	
	config = open("filechecker.cfg", "r")
	text = config.read()
	match = re.search(r"(dest=)(.*\.*)", text)
	
	return match.group(2)
	
def fileType():
	
	config = open("filechecker.cfg", "r")
	text = config.read()
	match1 = re.search(r"(src=)(.*)(\..*)", text)
	match2 = re.search(r"(dest=)(.*)(\..*)", text)
	if match1.group(3) == match2.group(3):
		return True
	else:
		return False
